import { request } from "@/utils/service"
import * as instance from '@/api/role/types/instance'

export function saveOrUpdate(data: instance.roleFormInstance) {
  return request({
    url: "/bg/role/saveOrUpdate",
    method: "post",
    data
  })
}

export function getRoleById(params: instance.getByIdFormInstance) {
  return request({
    url: "/bg/role/getRoleById",
    method: "get",
    params
  })
}

export function getList(params: instance.tableRequestData) {
  return request({
    url: "/bg/role/getList",
    method: "get",
    params
  })
}

export function getAllRole() {
  return request({
    url: "/bg/role/getAllRole",
    method: "get",
  })
}
export function deleteByRoleId(data: instance.delFormInstance) {
  return request({
    url: "/bg/role/deleteByRoleId",
    method: "post",
    data
  })
}
